package com.example.barcodeapp.persenter.own;

import com.example.barcodeapp.base.BasePersenter;
import com.example.barcodeapp.common.CommonSubscriber;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.model.HttpManager;
import com.example.barcodeapp.ui.home.bean.JiaoShiNeiRongBean;
import com.example.barcodeapp.ui.own.bean.KeChengBean;
import com.example.barcodeapp.ui.own.bean.LanMuBean;
import com.example.barcodeapp.utils.RxUtils;

public class OnePresenterjiaoshijiemian extends BasePersenter<IOwn.Viewjiaoshi> implements IOwn.Persenterjiaoshi {
    @Override
    public void getjiaoshineirong(int cc_id, int page, int search) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getjiaoshileibiao(cc_id,page,search)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<JiaoShiNeiRongBean>(mView) {
                    @Override
                    public void onNext(JiaoShiNeiRongBean hanFuDaBean) {
                        mView.getjiaoshineirong(hanFuDaBean);
                    }
                }));
    }

    @Override
    public void getjiaoshineirong(int cc_id, int page) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getjiaoshileibiao(cc_id,page)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<JiaoShiNeiRongBean>(mView) {
                    @Override
                    public void onNext(JiaoShiNeiRongBean hanFuDaBean) {
                        mView.getjiaoshineirong(hanFuDaBean);
                    }
                }));
    }

    @Override
    public void getjiaoshineironglanmu() {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getjiaoshileibiaolanmu()
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<LanMuBean>(mView) {
                    @Override
                    public void onNext(LanMuBean hanFuDaBean) {
                        mView.getjiaoshineironglanmu(hanFuDaBean);
                    }
                }));
    }


}
